<template>
	<view class="main">
		<view class="vip" v-for="item in vipListData" @click="vipDetail(item)">
			<view class="left">
				<view class="title">
					{{item.name}}
				</view>
				<view class="text">
					{{item.intro}},{{item.comment}}
				</view>
			</view>
			<view class="right">
				<view class="price">
					￥{{item.money}}
				</view>
				<view class="old-price">
					原价 ￥99
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {vipList} from "@/api/index.js"
	export default {
		data() {
			return {
				vipListData:[]
			};
		},
		mounted() {
			vipList().then(res => {
				this.vipListData =  res.data
			})
		},
		methods: {
			vipDetail(item) {
				uni.navigateTo({
					url: "/pages/mall/mall?item="+JSON.stringify(item)
				})
			}
		}
	}
</script>

<style lang="scss">
	.main {
		.vip {

			padding: 26rpx;
			display: flex;
			background-color: #fff;
			margin-bottom: 20rpx;

			.left {
				flex: 1;

				.title {
					font-weight: 600;
					font-size: 32rpx;
				}
			}

			.right {
				text-align: center;
				margin-left: 40rpx;

				.price {
					font-size: 32rpx;
					color: #E31716;
				}

				.old-price {
					color: #A1A1A1;
					font-weight: 400;
					position: relative;
					font-size: 28rpx;
				}

				.old-price::after {
					content: '';
					width: 100%;
					height: 1px;
					position: absolute;
					left: 0;
					top: 50%;
					background-color: #A1A1A1;
				}
			}
		}
	}
</style>